home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Education / PC-SiG's World of Education.iso / run / 2602 / datacq.alg < prev    next >
Encoding:
Text File  |  1989-06-28  |  1.7 KB  |  53 lines

  1. { DATACQ - demonstrates various simple data acquisition methods
  2.             using DAN's ANALOG, DIGITAL, DELAY, and TIME functions.
  3. }
  4.  
  5. { Method 1 - acquire a fixed number of samples as fast as possible }
  6.  
  7.     dur = 1000;  step=1;    {get 1001 samples}
  8.     type = "Hit 'carriage return' to start data acquisition";
  9.     acq1 = ANALOG(16);
  10.     label = "Method 1 - Fixed number of samples";
  11.     xlabel = "Sample Number";
  12.     ylabel = "Counts";
  13.     ymin = min(acq1) & ymax = max(acq1);
  14.     plot(acq1);
  15.     pause;
  16.  
  17.  
  18. { Method 2 - acquire fixed number of samples with time tags }
  19.  
  20.     step = 1; dur = 2000;
  21.     acq2 = 2.704*ANALOG(1) + 11.123  & time2 = time;
  22.     label = "Method 2 - Fixed number of samples with time tags";
  23.     xlabel = "Time of Day When Sample Acquired";
  24.     ylabel = "Some Engineering Units";
  25.     ymin = min(acq2) & ymax = max(acq2) &
  26.     txmin = min(time2) & txmax = max(time2);
  27.     constant(txmin);  constant(txmax);
  28.     xmin = txmin;  xmax = txmax;
  29.     xaxis = time2;
  30.     xformat = hours;
  31.     erase;
  32.     plot(acq2);
  33.     pause;
  34.  
  35.  
  36.  
  37. { Method 3 - acquire analog & digital data at slow speed with fixed intevals
  38.              between samples }
  39.  
  40.     step = .2;        {step size should = delay time}
  41.     dur = 60;        {acquire for 1 minute }
  42.                     {get data, convert to eng units,
  43.                     determine plot scaling, and delay .2secs between samples}
  44.     acq3 = .5*ANALOG(2)-50 & ymin = min(acq3) & ymax = max(acq3) &
  45.     dig1 = 100*DIGITAL(1) & delay(.2);
  46.     xaxis = t;        {reset to nominal}
  47.     label = "Method 3 - 1 minute of data sampled every .2 seconds";
  48.     xlabel = "Relative Time When Sample Taken";
  49.     erase;
  50.     plot(acq3) & plot(dig1);
  51.     pause;
  52.   pause;
  53.